﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers {
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class LoadTutorialAssets extends Command {

        public var tutorialModel:TutorialModel;

        override public function execute():void{
            var _local1:RequestEvent = new RequestEvent(EventConstants.SEND_REQUEST, this.onLoadAssetsResult);
            _local1.addAssetRequest(ProtocolConstants.LOAD_ASSET, GameConstants.TUTORIAL_ASSETS);
            dispatch(_local1);
        }
        private function onLoadAssetsResult(_arg1:ResultVO):void{
            this.tutorialModel.state = TutorialModel.LEVEL1_SHOW_FIRST_PET;
            var _local2:RequestEvent = new RequestEvent(EventConstants.SEND_REQUEST);
            _local2.addAssetRequest(ProtocolConstants.LOAD_ROOM, GameConstants.ROOMS_WAITING_ROOM);
            _local2.addAssetRequest(ProtocolConstants.LOAD_ROOM, GameConstants.ROOMS_BATTERY_ROOM);
            _local2.addAssetRequest(ProtocolConstants.LOAD_ROOM, GameConstants.ROOMS_TREATMENT_GENERAL);
            _local2.addAssetRequest(ProtocolConstants.LOAD_ROOM, GameConstants.ROOMS_RECEPTION);
            dispatch(_local2);
        }

    }
}//package net.wooga.pets.controllers 
